Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make v2_ mutation prefix configurable #636

Merged
merged 10 commits into from
Oct 25, 2024
Merged

Make v2_ mutation prefix configurable #636

merged 10 commits into from
Oct 25, 2024

Conversation

danieljharvey
Copy link
Contributor

@danieljharvey danieljharvey commented Oct 25, 2024

What

Pulled from #635 into own PR.

We add mutations_prefix: Option<String> to v5 configuration. When left null (for existing projects), we default to v2_mutation_name, but it can be replaced with horse_mutation_name etc.

Most people will just want to use it to remove the prefix though, and that is the default for new projects. mutationsPrefix: "" will get rid of the prefix altogether, which I assume most users would want.

How

@@ -4429,5 +4429,6 @@
"varchar": "string"
}
},
"mutationsVersion": "v2"
"mutationsVersion": "v2",
"mutationsPrefix": ""
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Before we added this, all the Postgres tests passed as before, after this, we had to go fix lots of things. Which means it works, which is good.

@@ -51,6 +51,9 @@ pub struct ParsedConfiguration {
/// Which version of the generated mutation procedures to include in the schema response
#[serde(default)]
pub mutations_version: Option<metadata::mutations::MutationsVersion>,
/// Provide a custom prefix for generated mutation names. Defaults to mutations version.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new config. serde(default) means old config that does not include this will get None, so we make sure that keeps old behaviour intact.

@danieljharvey danieljharvey marked this pull request as ready for review October 25, 2024 16:10
@danieljharvey danieljharvey changed the title Remove v2 prefix from mutation permissions Make v2_ mutation prefix configurable Oct 25, 2024
@danieljharvey danieljharvey added this pull request to the merge queue Oct 25, 2024
Merged via the queue into main with commit 859e0bf Oct 25, 2024
30 checks passed
@danieljharvey danieljharvey deleted the djh/remove-prefix branch October 25, 2024 16:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants